import React, {Component} from 'react';

class Product extends Component {
    constructor(props) {
        super(props);
    //    注意!!! query传值的方法,在组件中要通过props.location.query获取
        console.log(this.props.location.query)
        this.state={
            data:this.props.location.query
        }
    }
    render() {
        return (
            <div>
                <h1>这时商品组件</h1>
                <h1>{this.state.data.name}今年{this.state.data.age}女朋友是{this.state.data.gf.name}</h1>
            </div>
        );
    }
}

export default Product;